#coding:utf-8
# @Time    : 2018/9/28 16:38
# @Author  : 0x007er
# @File    : CheckRes.py
# @Software: PyCharm

import requests,re

results = requests.get('http://220.167.103.51/d.txt').text
ips = re.findall('\"ip\"\:\"(.*?)\"',results,re.S)
for ip in ips:
    try:
        res = requests.get("http://"+ip+'/images/',headers={"Host":"api.utm999.com"},timeout=3)

        print ip,res.status_code,res.headers
    except Exception as e:
        print ip,